<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位-相对定位</title>
    <style>
        
        .d1{
            width: 300px;
            height: 200px;
            background-color: cadetblue;
            /* 2.相对定位  相对的是原来的自己，表现是浮动的，但是原来的位置依然占领 relative */
            position: relative;
            top: 100px;
            left: 100px;
        }

        .d2{
            width: 300px;
            height: 200px;
            background-color: lightcoral;
            position: relative;
            top: 50px;
            left: 50px;
        }

        .clear{
            width: 500px;
            border-top: 3px solid orange;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <div class="d2"></div>
    <div class="clear">我是参照物</div>
</body>
</html>